package com.mark.tim.kutspel;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Tools {

	private static Bitmap planeImage;
	private static Bitmap bulletImage;
	private static Bitmap enemyImage;
	
	public static Bitmap getPlaneImage(Context context) {
		if (planeImage == null || MainActivity.changed) {										// plane1  -  plane_debug
			if(MainActivity.debug)  planeImage = BitmapFactory.decodeResource(context.getResources(), R.drawable.plane1_debug);
			if(!MainActivity.debug) planeImage = BitmapFactory.decodeResource(context.getResources(), R.drawable.plane1);
			MainActivity.changed = false;
		}
		return planeImage;
	}
	
	public static Bitmap getBulletImage(Context context) {
		if (bulletImage == null || MainActivity.changed) {										// bullet1  -  bullet_debug
			if(MainActivity.debug)  bulletImage = BitmapFactory.decodeResource(context.getResources(), R.drawable.bullet1_debug);
			if(!MainActivity.debug) bulletImage = BitmapFactory.decodeResource(context.getResources(), R.drawable.bullet1);
		}
		return bulletImage;
	}
	
	public static Bitmap getEnemyImage(Context context) {
		if(enemyImage == null || MainActivity.changed) {
			if(MainActivity.debug)  enemyImage = BitmapFactory.decodeResource(context.getResources(), R.drawable.enemy1_debug);
			if(!MainActivity.debug) enemyImage = BitmapFactory.decodeResource(context.getResources(), R.drawable.enemy1);
			if(MainActivity.ronald) enemyImage = BitmapFactory.decodeResource(context.getResources(), R.drawable.ronald2);
		}
		return enemyImage;
	}
}
